﻿using System;
using System.Collections.Generic;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace FighttheLandOwner.GameCore
{
    class Game
    {
        
        public CardManager CardManager { get; set; }
        public static CardGroup LastGrp { get; set; }
        public Game()
        {
            CardManager = new CardManager();
            LastGrp = new CardGroup(new List<Card>());
            var cards = CardManager.HandOutCards();
            
        }

        /// <summary>
        /// 判断牌能不能出
        /// </summary>
        /// <param name="cards"></param>
        /// <returns></returns>
        public static bool JugeCards(List<Card> cards)
        {
            var group = new CardGroup(cards);
            if (group.CardGrpType== CardGrpType.Error)
                return false;//错误牌型 返回0
            if (LastGrp.Cards.Count == 0)
                return true;
            return true;
        }


        public static bool Myturn = false;

        public static bool JugeOut(List<Card> cards)
        {
            if (Myturn)
                return true;
            var group = new CardGroup(cards);
            if (group > LastGrp)
            {
                //LastGrp = group;
                return true;
            }
            return false;
        }
        
    }
}
